home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_monkeykey.cog < prev    next >
Text File  |  1999-11-15  |  6KB  |  232 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_MonkeyKey.cog
  4. #
  5. # monkeyKey = 54
  6. #
  7. # [TRM]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15.     message     startup
  16.     message     activated
  17.     message     entered
  18.     message     pulse
  19.     
  20.     thing       player      local       
  21.     thing       torch0
  22.     thing       torch1
  23.     thing       flame0
  24.     thing       flame1
  25.     thing       interpCam
  26.     
  27.     thing       monkeyKey
  28.     
  29.     thing       debrisPos0
  30.     thing       debrisPos1
  31.     thing       debrisPos2
  32.     thing       debrisPos3
  33.     thing       debrisPos4
  34.     thing       debrisPos5
  35.     thing       debrisPos6
  36.     thing       debrisPos7
  37.     
  38.     sector      wat_Sec0        linkID=1
  39.     sector      wat_Sec1        linkID=1
  40.     sector      wat_Sec2        linkID=1
  41.     sector      wat_Sec3        linkID=1
  42.     
  43.     template    tpl_Debris=+dummy_debris        local
  44.     
  45.     sound       burning=gen_torch_burnin_c.wav      local
  46.     sound       lite=gen_torchlitet_c.wav           local
  47.     sound       snd_Key=Inxj169.wav                 local   # i think it's a key
  48.     
  49.     # ** music **
  50.     sound       mus_Danger=mus_jep_indyrescue1b.wav local
  51.     
  52.     cog         talkCog         local
  53.     cog         debris
  54.     cog         cameraShake
  55.     cog         cog_Hint
  56.     
  57.     flex        flickertime=2.0
  58.     flex        lituptime=0.5
  59.     flex        maxradius=0.3
  60.     flex        minradius=0.3
  61.     
  62.     # ** subroutines **
  63.     flex        pickupKey       local
  64.     
  65.     vector      minlite         local
  66.     vector      maxlite         local
  67.     vector      zerolite        local
  68.     
  69.     int         lit=0           local
  70.     int         killIt=0        local
  71.     
  72. end
  73.  
  74. # ========================================================================================
  75.  
  76. code
  77.  
  78. startup:
  79.  
  80.     minlite = VectorSet(0.87, 0.55, 0.06);
  81.     maxlite = VectorSet(0.89, 0.64, 0.30);
  82.     zerolite = VectorSet(0.25, 0.25, 0.0);
  83.     
  84.     SetThingFlags(flame0, 0x10);
  85.     SetThingFlags(flame1, 0x10);
  86.     SetThingLight(torch0, zerolite, maxradius, 0.1);
  87.     SetThingLight(torch1, zerolite, maxradius, 0.1);
  88.  
  89.     return;
  90.  
  91. # ========================================================================================
  92.  
  93. activated:
  94.  
  95.     player = GetLocalPlayerThing();
  96.     
  97.     if ((GetSenderRef() == monkeyKey) && (lit == 0))
  98.     {
  99.         # player activated with an IMP part so bail out
  100.         if((GetCurWeapon(player) >= 14) && (GetCurWeapon(player) <= 18)) return;
  101.         
  102.         # player activated with lighter
  103.         else if(GetCurWeapon(player) == 13)
  104.         {
  105.             lit = 1;
  106.             
  107.             # put away the lighter
  108.             DeselectWeapon(player);
  109.             DeselectWeaponWait(player);
  110.             
  111.             Call pickupKey;
  112.         }
  113.         
  114.         # normal activation
  115.         else
  116.         {
  117.             lit = 1;
  118.             
  119.             # wait for weapon to be put away
  120.             DeselectWeaponWait(player);
  121.             
  122.             Call pickupKey;
  123.         }
  124.     }
  125.     
  126.     return;
  127.         
  128. # ========================================================================================
  129.  
  130. entered:
  131.  
  132.     if(GetSenderID() == 1)
  133.     {
  134.         if(killIt == 1)
  135.         {
  136.             killIt = 0;
  137.             
  138.             # turn off falling debris
  139.             SendMessage(debris, user1);
  140.             SendMessage(cameraShake, user1);
  141.             
  142.             SetPulse(0.0);
  143.         }
  144.     }
  145.     
  146.     return;
  147.  
  148. # ========================================================================================
  149.  
  150. pickupKey:
  151.  
  152.     # solve hint29
  153.     SendMessage(cog_Hint, user0);
  154.     
  155.     # do cutscene stuff
  156.     MakeMeStop();
  157.     StartCutscene(0);
  158.     
  159.     # offset camera
  160.     #SetExtCamOffsetToThing(interpCam);
  161.     
  162.     # pick up the key
  163.     PlayMode(player, 60, 0);
  164.     
  165.     # Call the Pickup Lines cog
  166.     talkCog = GetCogByIndex(0);
  167.     SendMessage(talkCog, 27);
  168.     
  169.     # rest and then destroy key
  170.     Sleep(0.3);
  171.     DestroyThing(monkeyKey);
  172.     
  173.     # add monkeykey to inventory
  174.     SetInvAvailable(player, 54, 1);
  175.     ChangeInv(player, 54, 1.0);
  176.     JonesInvItemChanged(54);
  177.     
  178.     # sleep for a bit to wait for talkCog
  179.     Sleep(1.0);
  180.     
  181.     # Johnny, tell the player what he's picked up
  182.     PlayVoice(player, snd_Key, 1.0, 1);
  183.     
  184.     # return camera to player
  185.     RestoreExtCam();
  186.     
  187.     # play music cue
  188.     PlaySoundLocal(mus_Danger, 1.0, 0.0, 0x0, 0);
  189.     
  190.     # return control to player
  191.     ClearActorFlags(player, 0x200000);
  192.     EndCutscene();
  193.     
  194.     Sleep(0.5);
  195.     
  196.     # light the torches
  197.     ClearThingFlags(flame0, 0x10);
  198.     ClearThingFlags(flame1, 0x10);
  199.     PlaySoundThing(lite, torch0, 1.0, 5, 15, 0x0);                                 
  200.     PlaySoundThing(lite, torch1, 1.0, 5, 15, 0x0);
  201.     SetThingLight(torch0, minlite, maxradius, lituptime);                           
  202.     SetThingLight(torch1, minlite, maxradius, lituptime);
  203.     
  204.     PlaySoundThing(burning, torch0, 1.0, 5, 15, 0x1);
  205.     PlaySoundThing(burning, torch1, 1.0, 5, 15, 0x1);
  206.     
  207.     # turn on falling debris
  208.     SendMessage(debris, user0);
  209.     
  210.     # shake the place
  211.     SendMessage(cameraShake, user0);
  212.     
  213.     # start damage debris
  214.     SetPulse(0.75);
  215.     killIt = 1;
  216.     
  217.     return;
  218.     
  219. # ========================================================================================
  220.  
  221. pulse:
  222.  
  223.     # create debris
  224.     CreateThing(tpl_Debris, debrisPos0[RandBetween(0, 7)]);
  225.     
  226.     return;
  227.         
  228. # ========================================================================================
  229.  
  230. end
  231.  
  232.